﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SLCommon
{
    public abstract class FactoryBase:IInitable
    {
        protected Dictionary<int, IPipeline> pipelines = new Dictionary<int, IPipeline>();
        public IProduct Create(int type)
        {
            return pipelines[type].Create();
        }

        public void Recycle(int type, IProduct item)
        {
            pipelines[type].Recycle(item);
        }

        public abstract void Init();
    }
}
